Skip to content

fix: replace the usage of pseudo-element for hover and active styling on vanilla-extract components - #5227

Merged
traefiker merged 7 commits into
traefik:masterfrom
gndz07:fix/pseudo-hover
Nov 27, 2026
Merged

traefiker merged 7 commits into
traefik:masterfrom
gndz07:fix/pseudo-hover

Conversation

@gndz07

@gndz07 gndz07 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Description

Vanilla components now draw hover, focus and pressed backgrounds as background-image layers on the element itself, instead of on ::before and ::after. A custom background color set through css or className keeps the states on top. Overriding a state takes one rule on the element. Text is no longer tinted by an overlay. The primary tint is now a primaryTint theme token, applied with a small stateLayers helper.

Pseudo-elements stay where they draw part of the component rather than a state:

  • Avatar: ring
  • Bubble: pulse and dot
  • Radio: dot
  • RowLink: stretched link
  • Skeleton: pulse
  • Table: header and footer layers
  • Button: waiting stripes

Breaking changes are documented in BREAKING_CHANGES.md under "State Backgrounds: Layers Instead of Pseudo-Elements".

ℹ️ not ready to merge, wait for #5225 and #5226 to merge, and then adjust their styling to follow this pattern as well. Navigation elements on 5226 should have have this pattern already, but the function is limited to its own scope.

@mdeliatf mdeliatf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@traefiker
traefiker merged commit 58af02d into traefik:master Nov 27, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 13.16.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants